package cn.tedu.csmall.product.controller;

import cn.tedu.csmall.product.pojo.dto.AdminDTO;
import cn.tedu.csmall.product.service.IAdminService;
import cn.tedu.csmall.product.web.JsonResult;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/admin")
@Api(tags = "管理员模块")
@Validated
public class AdminController {
    @Autowired
    IAdminService service;
    @PostMapping("/add-new")
    public JsonResult addNew(@Valid AdminDTO adminDTO){
        service.addNew(adminDTO);
        return JsonResult.ok();
    }
}
